/*
 * @lc app=leetcode.cn id=448 lang=csharp
 *
 * [448] 找到所有数组中消失的数字
 */

// @lc code=start
public class Solution {
    public IList<int> FindDisappearedNumbers(int[] nums) {
        for (int i = 0; i < nums.Length; i++)
        {
            int newIndex = Math.Abs(nums[i]) - 1;
            if (nums[newIndex] > 0)
            {
                nums[newIndex] *= -1;
            }
        }
        List<int> result = new List<int>();
        for (int i = 0; i < nums.Length; i++)
        {
            if (nums[i] > 0)
            {
                result.Add(i + 1);
            }
        }
        return result;
    
    }
}
// @lc code=end

